package main

import (
	"fmt"
	"time"
)

func main() {
	ticker := time.NewTicker(2 * time.Second)
	defer ticker.Stop()

	// 若通道为空，则阻塞
	// 若通道有数据，则读取
	// 若通道关闭，则退出
	go func() {
		for range ticker.C {
			fmt.Println("ticker ticker ticker1 ...")
		}
	}()

	for range ticker.C {
		fmt.Println("ticker ticker ticker2 ...")
	}

}
